﻿package com.toncen.samepms.system.action;

import com.toncen.samepms.common.AbstractDatabaseAction;
import com.toncen.samepms.system.dao.SchedulerJobDao;
import com.toncen.samepms.system.domain.SchedulerJob;

/**
 * 描述：计划任务表SYSTEM_SCHEDULER_JOB的action文件
 * 
 * @author tch
 * 
 */
public class SchedulerJobAction extends AbstractDatabaseAction<SchedulerJob, SchedulerJobDao> {
	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 1341973942681L;

	public SchedulerJobAction() throws Exception {
		super();
	}

	/**
	 * 立即执行任务
	 * 
	 * @return
	 * @throws Exception
	 */
	public String onDoImmediatelyRun() throws Exception {
		prepareOnDoEdit();
		getDao().immediatelyRun(getDomain());
		return SUCCESS;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.toncen.samepms.common.AbstractAction#prepareOnDoSave()
	 */
	@Override
	public void prepareOnDoSave() throws Exception {
		super.prepareOnDoSave();
		getDomain().getJob();
	}

}
